import pytest


@pytest.fixture()
def login(request):
    print("---前置：登录")

    def after():
        print("---后置：退出")

    request.addfinalizer(after)


def test_a(login):
    print("--------------test_a")


class Test01:
    def test_b(self, login):
        print("--------------test_b")

    def test_c(self):
        print("--------------test_c")